<template>
  <div class="fly-panel fly-link">
    <h3 class="fly-panel-title">友情链接</h3>
    <dl class="fly-panel-main">
      <dd v-for="item in list" :key="item.id">
        <a :href="item.link" target="_blank">{{ item.title }}</a>
      </dd>
    </dl>
  </div>
</template>

<script>
import { links } from '@/mock/slidbar'
import { getLink } from '@/api/comtent'
export default {
  name: 'links',
  data () {
    return {
      list: links
    }
  },
  created () {
    this._getLink()
  },
  methods: {
    _getLink () {
      getLink().then((result) => {
        if (result.code === 200) {
          this.list = result.data
        }
      }).catch((err) => {
        console.log(err)
      })
    }
  }
}
</script>
